import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home,
    children: [
      {
        path: "/",
        redirect: "/recommend"
      },
      {
        path: "recommend",
        component: () => import("@/pages/recommend.vue")
      },
      {
        path: "rank",
        component: () => import("@/pages/rank.vue")
      },
      {
        path: "singer",
        component: () => import("@/pages/singer.vue")
      },
    ]
  },

  {
    path: "/musicsheet",
    component: () => import("@/pages/musicsheet.vue")
  },
  {
    path: "/singerDetail",
    component: () => import("@/pages/singerDetail.vue")
  },
  {
    path: "/search",
    component: () => import("@/pages/search.vue")
  },

]

const router = new VueRouter({
  routes,
  linkActiveClass: "active"
})

export default router